avoid infinite loop error