Working file saving function