updated session handling