minor error in search func