fix a concurrent modification bug due to not propogate locals