Fixes a crash in the search controller