auto register/unregister listeners