Fix is_teacher_valid method