small encode fix