Fix searching crash bug