Update server.js

Fix logic mistake