closesession and cancel bug fix