Fixes major loop error