fixing crash on search