text: If Endless Detour is targeting a spell and that spell is countered or otherwise goes to its owner's graveyard before Endless Detour resolves, it is no longer the same object and it will not be put on the top or bottom of its owner's library.