Molecule assisted ferromagnetic atomic chain formation