update started_at, finished_at logic