Update application.py

Fixed the way packets are consturcted