correctly shutdown