fixed search field logic