WeakIdentityHashMap replaced with working version