get rid of ugly System.exit()