changed destructors to prevent crash on exit (nw)