Fix bug where 'timer' wasn't defined