Added session handling