improved session stuff