Trying to prevent infinite loops