finish dynamic process loaded and add some middleware.