add ids to patterns