added support for subclassing Session