added index, message length, and MD5 validation in the packet