converted Trick to use an array instead of a map
Still the long running processes don't complete