Added System.exit(0) to non interactive mode