updated timer logic