fix session listener and test