Add logic to set end_time from duration