make duplicate heading IDs unique by adding counts