Third party wrapping fix to the closure that grabs `window`