Fixed bug with packet sending API