fixed bug with updating query after clearing all