Add try/finally block to ensure stopTimer call