you also need to reset the debug handler on shutdown so that it does not keep a reference to the container preventing the garbage collection