fixing bug with timer