update map.erase to return the removed pair