Added check if the type is a primitive