You're probably doing buffer overflows, but it is impossible to say exactly how things are wrong without seeing your current code. You could have misunderstood how UTDs work or how data is storaged in them, or you could just overwrite the byte arrays, or etc.