fixes addChild method