Fix for unstable file saving