You’ve always dreamed of having kids and can’t wait to get started (or get pregnant again). But there’s an important piece to consider when contemplating family planning: The length of time between pregnancies.

A new study looked at 148,544 pregnancies of women who had more than one baby. Researchers found that an interval of 18 months between giving birth and getting pregnant again was ideal for both baby’s and mom’s health. There is still some benefit for waiting at least 12 months. This was true for women of all ages, but even more so for women over age 35.

For baby: Getting pregnant again within six months increased the risk for preterm delivery among all women in the study—the risk was 5.3% for women ages 20 to 34 and 5% for women over 35 vs. 3.2% and 3.6% respectively for those who waited 18 months. Babies who are born too early face a host of health problems including lung issues, poor feeding and slow weight gain.

For mom: For women 20 to 34, the risk for serious complications, such as organ failure or the need for blood transfusions, or death was only slightly changed—0.23% after six months vs. 0.25% after 18 months. But for women over 35 who got pregnant six months after a previous birth, that risk was 0.62% compared with 0.26% among those who waited 18 months.

Younger women may find it easier to wait longer between pregnancies. They likely don’t feel the biological clock ticking as loudly as women over 35 who face issues including having a hard time getting pregnant and growing concerns over birth defects. These factors often lead women over 35 to more closely space pregnancies. After all, waiting even 12 months between babies means, at best, four and a half years to have three children, and that’s if conception goes like clockwork—it’s entirely possible that it won’t, and that longer intervals would result in not being able to have as many children as desired. So, what’s the answer?

If the ideal waiting period isn’t ideal for your circumstances, take these steps to protect your health and your baby’s…

Work very closely with your doctors. See your primary care doctor for a full checkup before getting pregnant again. This is important for all women, but especially those 35 and over because health risks rise with advancing age. Make sure that your blood sugar, blood pressure, cholesterol and weight are in a healthy range or are being properly managed. Testing may also include a mammogram if you are 40 or older. Estrogen levels rise during pregnancy, and this can feed a breast cancer and make it grow faster. You should also be up-to-date on your vaccinations including your yearly flu shot. Vaccines can help keep your immune system in tip-top shape, so it can better protect you and your baby.

Work hard to lose any excess weight. It’s definitely difficult to lose pregnancy weight, and shorter intervals between pregnancies make it even harder. But when you’re overweight, your risk for diabetes, high blood pressure, high cholesterol and fatal blood clots is higher. Being at your ideal weight when you become pregnant again helps to lower all of these risks and makes for a safer, healthier pregnancy.

Use protection. Many closely spaced pregnancies are actually unintended. Regardless of your age, use contraception if you don’t want to get pregnant…yet.

Don’t panic. While the study did show higher risks with shorter intervals between pregnancies, the absolute risks are still low. Most pregnancies result in a healthy baby and mom.