Save On Exit functionality added