When running in release mode the timer variable would be garbage collected and stop calling back. Fix this by making it a class member