infinite loop eradicated