fixed badge assertion / class check logic