Added check for empty search string.