added middleware.js