only infinite loop not working