add write file gate