replaced middleware with build script