changing class checking to allow inheritance..