Fix AI and clearInterval problem