move unregistration of listener to onDestroy.