fixed infinite loop?