Add System.exit(0) at the end of function