Trying to avoid eternal loop