fix the upper and lower in the search function