The organization was destroyed and with it went the cure there was really no other way Ai had went to get the poison when they found out the positions of all the hideouts over summer break, Conan set the bombs and the organization was destroyed except for the main office, where Ai was, she set up her bombs and went to find the poison in order to make the antidote she was caught on her way out, she set off the bombs immediately, after searching he found her remnants along steal case with a single pill in it, it was no use Ai was the only one capable of making the antidote, he wasn't going to risk the existence of the last pill for an impossible quest not when he had plans for it. That night he told Ran everything and gave her the pill saying "Take this only if you truly love me for taking it means you will give up all your friends and your vary exsistance, only take this if you are truly willing to give all that up for me" and so there was no more Ran, Ai revealed to every one that she had been dying her hair and had chosen to stop over summer break. Ten years later Ai and Conan were married.

AN- incase you didn't get it Ran took the pill and took Ai's place