Add logs and change the retrieval logic for instance students to avoid
duplication of instance students.