added some timer logic