fix bug in encoder and fix config