fix error in writeTransformation