SessionFactory fix