How to add container objects to physics

Trying to add container objects to physics crashes the game without any error logs. Here is what I am trying to do:

local headName=“images/expressions/01.png”

  local headOutline = graphics.newOutline( 2, headName )

  

  local headAnim = {

    “images/expressions/01.png”,

    “images/expressions/02.png”,

    “images/expressions/03.png”

}

local head = display.newContainer(80, 100);

  head.x=display.contentCenterX/2+100

  head.y=display.contentCenterY/2

for i = 1, #headAnim do

    local frame = display.newImageRect(head, headAnim[i], 80, 100);

    frame.isVisible = false;

end

head[1].isVisible = true;

head.currentFrame = 1;

ragdoll:insert (head)

– Code crashes when the below line executes

physics.addBody (head, {outline=headOutline, bounce = e, density=d, friction=0.4})


Any ideas on why the above is failing… What can be a work around for this…