fixed time-edit function