fix search bugs