cleaned up shutdown