Save scale factor when exiting