TMP: add some debugging code to try and catch intermittent issue