added On Exit method override to save the model