fixed register/unregister interaction