no longer crashing on shutdown