Fix crashing bug on empty search string