Implemented saving at quit time