fixed bug in print_hex