removing use of self.window. crashes on node.js

There is no self.window in node.js must remove.