BUG-904 fix closing session