Fixed undefined window
1.0.2