fixed issues with session factory