Fixed wrong usage of var in server/middleware.js