fixed error with ajax searching - close #537