file saving bug fix