This is wrong. The check needs to check for IMolecule if it is going to cast it to IMolecule.
Keep the old code untill MoleculeSet is replace