Add max duration to tasks.