hot fix to write attachment file :'(