fixing quuery