Ensuring empty rows are not inserted