Found and fixed a bug in search function, when clearing the queue next (line 55)