Fixed bug with searching