Fix bug when query in continuously clicked