Fix crash in search