Modified the UI so it exits and no longer has errors when clicking on the x