Ooops the code was longer than I was reading, and adding a end character to the read exposed that I was truncating the value. Now it has the correct UID being printed