adding error code resetting