added session-related code