small fix
bug fix: th_cls can be greather then 1, when first class is much smaller then the second