security check for error codes