added in window.close() to prevent jsdom memory leak