added isScalar method