Should return error when name is not present in the map.