Unregister the listener when we're detached otherwise it can be called and we crash