BUG: Used continue instewad of return to stop foreach returning early