window object used inappropriately in node