Synchronization avoid map.clear() NPE
Refine