fix backwards logic on duration calculation