I don't get why we need this part.
if the map does not contain the key why iterate on the entries?