trying to make shutdown safer
trying to make shutdown safer
fixing deinitalization of monitor