Checking for existence of element in map before deleting.