fixing bugs in light_server.js