preventing endless loop