Making sure that we explicitly close the session since that XMS api seems
to leak sessions if not called