avoid wrong value of boolean doAnimate