packet handling on client