adjusted the the error case in the query methods