more robust prefix parsing
framing incomming data properly