bug fix in addCls method