updated write filename