Fix the error in selecting teachers for CGR with year groups