remove endless loop