Implement shutdown callback