avoid infinite loop