Theoretically got the endSession working.