fixed error code status handling