allow different duration for the function