Scripts stops when App-closing is canceled