moved away from manual session handling to dynamic session handling