Attach to window if it exists