change writePacked signature