fixing termination dependency calculation