Fixed timer and restart bug