fixed bug in hex output routine