proper shutdown when sketch is closed