reseting query properly for search