move list_remove back into do_waitpid