fix stop_criteria encoding problem