fix retrieving SessionFactory

Issue #15
Merge pull request #16 from metridoc/fix-session-factory

fix retrieving SessionFactory