added onSessionEnd and fix for non-plotting event