fixed a bug on repeated subjects.