fixing query for results