implement shutdown command properly