fix an issue for search function