add ability to support passing a session