fixed bug when searching