add toggle task function.
fix toggle task errors.
fix toggle bugs.
Merge pull request #20 from BestKen/master

add toggle feature.