Fixing timer bug: when timer is canceled, it can not be scheduled. Then,
timer needs to be initialized every time it'll be scheduled.