Fix issue with open sessions