added second parameter (session) to PIP event handlers