perhaps writing a wrapper for OnWrite and return false a better hack than encoding == null.