added the code to convert hex string to char array