Small bug fix, optimization on timer