fixed iterator problem