fix hex encode