Fix issue with canceling programs