fixed iterator issues