Fix endless loop
Fix endless loop some more