Fix: Invalid argument supplied for foreach()

no need for second foreach