moved timer init and start outside while