fix source of infinite loop