added proper shutdown of computations when grid window closed