toLoop was initialized as {}. Should it be recast to an array here?