fix addclass bug and add class related test case