maybe fix infinite loop