Fixes a concurrancy problem with a HashMap