Fixed file saving bug for linux