fixed bug when chain encoding to eol