replace Codec with checked_codec