Added some robustness to the protocol, more reliable
while transferring package data over the socket