item is the problem causer so if item makes units_map KeyError then pop(item) would do the same. Also, wouldn't want to pop a profileunit if for whatever reason the append errors out.