list to arrary to avoid concurrent issues on the hashmap iterator