use more accurate error codes