repair compatibility of Buffer with js browser client