modified to manage classId instead of className + solved some bug on refreshig classifications