Moved "build" block to the separate middleware.