3.1 infinite loop fix