fixed bug in generating/sending packet flow