fixing bug in encoding