changed from exit on close to dispose on close for GUI