Cobie Smulders and Kal Penn

Spoiler alert: This story reveals major details from this week's episode of How I Met Your Mother. Within the span of two episodes of the CBS comedy, Robin (Cobie Smulders) learned she was pregnant, only to be hit with the double whammy last night's episode she was in fact not pregnant — and could not have children.

That's some pretty heavy territory for the often-outrageous sitcom. Why did the show put Robin through such a wide range of emotions? It's all part of a master plan, says executive producer Carter Bays, explaining the decision was made this past summer to make Robin infertile.

"This was an important moment we wanted to hit for the series arc," Carter tells me. "We've always said that Robin doesn't have kids, but thought it would be interesting to see how a door being closed to her would effect her. Even if she always thought she never wanted kids, it's still tough to hear. And frankly, it's something we're nervous about. It's one thing dealing with Marshall's father dying, but in many ways this is a much more sensitive issue. And we hope we do it justice."

Carter believes this turn of events is the beginning of a change for the character. "We're setting off an arc to explore more of Robin's professional life," he says. "We're also looking to get into some of her issues — like the inability to open up and share with people. This will drive the second half of the season and come to effect her relationship with Kevin and other members of the group."

Subscribe to TV Guide Magazine now!