fix where query