1. modify task close procedure
2. add TDD test