fixed undeclared variables in server.js