Fix Undefined `foreach`