unregister in both window and sw