Change check against object class to use isKindOfClass rather than string comparison