encode fix