able to close window. handling for what happens once window closes. have to clean memory leaks