fix SQL in searches model