fixing bug in query