Fixed the issue with multiple layers of folders and giving correct node.url to the new window object.