Data sending code moved from receivePackets() to sendDataToFrontEnd()