Added validation for class exists in set handler