added uglifyify and updates for middleware