trying to fix infinite loop bug