fix unknown bug: infinite loop