fix endless bug