Fixed issue of menu bar not fully closing program when clicking 'exit' menu item