Fix file saving issue