add middle-ware for x-runtime