fixed onSessionEnd definition