Pause task

Please test whether pause/resume is working for you and then merge the pull request.