fixed a bug which appeared when the first line was encoded using