add code to restore from saved session