window object change, and cleanup