added shutdown on agent