Just do this after line 322 above, since we know the entity exists by then, and don't need to loop through and test again. Also, `add(Object)` can't throw an exception, so the try/catch isn't needed, in which case maybe add after line 325 above, outside the try/catch block as well.