fixed bug when retrieving all teachers subjects groups links between each other