write2file updated