Muhammad ibn Qays narrated from Abu Ja'far Imam Muhammad ibn Ali Al-Baqir عليه السلامregarding a man who married a woman under the assumption that she was free, but then another man came forward and presented evidence proving that she was his slave, what is the ruling? Imam عليه السلام said: "He (the rightful owner) takes her back and also takes the value of her child."