changed bin to arraybuffer