bug in hex to dec