Might have fixed infinite loop?