fix packet validation