Fix infinitive loop