added better search button handling