add cancellation support to timer