use self because it works in web workers as well as normal windows

will fix #10