Attempt to fix infinite loop