fixed search code