Edit MainExtry to support XAgent