Correctly determined if window is undefined on node