Blatantly obvious/simple same sort of thing.
Yes that is exactly what I had originally. However as you and I have both stated that the first line is all messed up and this is causing problems. After the first line all works fine.
I am also researching how to fix this at the other end by adding a handler for a Null value received.