fixed bug in searching