Update server.js

Fixed bug: "TypeError: Cannot read property 'secondary' of undefined