changed new Date().getTime() to Date.now() on server side