The original addEntry can delete the entry that is passed in, but we have no way to know
about it, so when that happens if we try to use the entry afterwards it will crash
This patch changes all the cases where addEntry was used and the entry passed to it is used later in the code