update for encoding