add undo state tests, #68, fix a bug of update active_delegate_list_id