Moved timer to global scope
Moved timer to global scope