just realized that scala's mutable HashMap is not thread safe