added a class check