Added infinite loop in main method