changed global element to explicit window