safeApply and safeDigest