add new window close listener to classes

on close the windows will open up a new main menu for usability