Fix for iteration count isssue