unfinished work with do_register