fixing hexadecimal conversion