Moved System.exit(0) out from run method.