Add ID to each of the constraint. So now the constraint is not accessed using their index, but the unique ID, which is more robust