Baby not sleeping well? It could be because you're sharing a room with your little one.

Now, a study that will be published in the July issue of Pediatrics found that babies who shared a room with their parents slept less than those who did not. The study, called Intervention Nurses Start Infants Growing on Health Trajectories, studied 230 mother-infant pairs from January 2012 to March 2014. The infants fell into three categories: those who were independent sleepers by 4 months (62 percent), those who were independent sleepers between 4 months and 9 months (27 percent), and those who were still sleeping in the same room as their parents at 9 months (11 percent).

The study was actually about obesity prevention, but researchers found that there were differences in bedtime routines. Babies who shared a room at 4 months were less likely to be put to bed before 8 p.m. They also were more likely to have something in their bed that shouldn’t be there, such as a blanket, pillow or stuffed animal, and were more likely to be brought into their parents’ bed sometime in the night.

How long babies slept was also different. By 9 months, the babies who had been sleeping independently at 4 months slept a stretch of 7 hours and 49 minutes. The room-sharing babies were sleeping only 7 hours in a row at 9 months.

What researchers found was it was all about establishing those bedtime routines: when a baby gets put to sleep, how often a baby is fed in the middle of the night and whether a baby is fed back to sleep or goes back to sleep on his own.

The American Academy of Pediatrics doesn’t want to revise its recommendations about room sharing, but it does acknowledge that parents want to get more sleep and that more research needs to be done to consider whether it should reverse its new policy.

Report Says Infants Should Sleep In Parents’ Room At Least 6 Months