Fixed a problem when the search string is the empty string