detect error codes