fix packet appending