Fixed hanging problem; had to do with count($iterator).