fixing bug when encoding a key who's value is a zero value