when the top is used it actually returns the [object Window] and the popup doesn't open in the correct location.