Updated timer logic