fixed server.js
added some logging