fixed search bug and syntax error