adding check for primitive types since attributes now come from ivars