Fix the bug in vulnerable period estimation