added session handling