Fixed 500 error on search