Fixed the AWT thread waiting for the program to end before doing stuff