added activate function to window