Add validation for non-null duration