Fixing id problem when drawing heatmaps