Begin fixing query error