add error detect in hex2bin()