Fix 2 issue: 1, Demo not work; 2, Should stop the timer loop when comes back to the frond