add_duration function