modify fromBinary methond