improved protoBuffer
added checks