added isBuffer