Added timer logic