Fixed a bug for search on empty string