added foreach to iterator