Added window listener
Removed console writelines