fixing bug in timer.