another interface to codec.
bugfix