fixed bug #4 (pid, d-term)