add shutdown method.