The function toPack was corrected