attempt to fix endless loop