Thanks for this. I had the same problem and this turns out to be the solution.