fixed filter issue in query