fix bug with canceling