encode finished