Fixing issue with unbinding events from window;