added back folder writing to quit method