added in middleware to cleanup html output for the serve/build process