fixed iterator bug