finally got it working with proper singletons