Added a System.exit(0) call at closing

Program was not terminating when closed