fix the bug of searching