Assure proper termination using context session