fixed "search" function