fix state bug
fix timer stopping