Fixed issues with packet loop