Emit close before removing listeners