Fixing crash on certain searches