prevent timer from being garbage collected

The timer stops working after a short time due to being garbage collected and does not update the display anymore. This pull request introduces a static variable for the timer to fix the issue.