assign each visit an ID and rebuild version