fixed search bugs