what is the purpose of first unregistering the listener?