write to beta_file