fixed to convert an ArrayBuffer to a Buffer