Fixed file saving bug