Add error code and exit