made change to server.js following @blai's suggestion