updated server.js with url check