For histories with identical names, append and handle IDs