how long does it take to miscarry