fix thread conflict issue when unscheduling timer