fixing query filter