Implemented send packet function