correctly retrieving session id