added __modulename, window is undefined error fixed