Using OnCreate to initialize session flushmode