fix handling of stopping a timer