added infinite loop in Main.java