adding assert to register() function, for consistency check.. and TODO, for today's debugging with @wangguan59