work on node module. check for existance of window