reform the code of global.cc and add ushort