DLL exception fix using __try and __except. Support for session saving every 10 seconds.