hopefully fixed the infinite loop bug.. again