added a check for negative duration.