Add retry mechanism to resolve BufferOverflowException