Fix to teardown to work without session id