A device comprises a bottom package comprising interconnect structures, first bumps on a first side and metal bumps on a second side, a semiconductor die bonded on the bottom package, wherein the semiconductor die is electrically coupled to the first bumps through the interconnect structures. The device further comprises a top package bonded on the second side of the bottom package, wherein the top package comprises second bumps, and wherein each second bump and a corresponding metal bump form a joint structure between the top package and the bottom package and an underfill layer formed between the top package and the bottom package, wherein the metal bumps are embedded in the underfill layer.