fix bug when timer callback add new timer, add some new tests