fix a React invariant violation