fixed write for non windows machines