fix bug with search button not being disabled and added comment for explanation