small bug in search_element