fix IDs (still a bit buggy)