fix long term working bug

1. add comments
2. simplify the code
3. remove watchdog and fix the long term work problem