writing control file