fix bug with getting binary length in decode_binary