fix retrieving SessionFactory

Issue #15