fix queue's lifecycle

have to call unregister() before calling register() again