fixes #1595

cancel scheduled tasks when needed