Really we would just be guessing as to what could be wrong. Is the tank still running? If you plan on getting another fish then you would be wise to carry out a large water change. I don't see how treating the tank with a parasitic medication is going to help your situation, most parasites that are found inside fish have been ingested somehow that are not free swimming like Ick.
If indeed your fish did have an internal worm parasitic infestation then maybe you should try a look back at what you were feeding the fish, this may give you an indication of where the worms came from. Obviously sourcing your fish from reliable sources always a good idea so before buying any fish, have a good look at it and make sure that it doesn't look ill, or abnormal in any way.