Fixed a null bug in server.js