fix: use isBuffer() to check data type