encoding fix for second run