No worries, I was being a nonse. Was hidden in my coding.
Strange though as that code line would not have been executed, but managed to stop agent from running once compiled.
I referenced ‘doc’ rather than ‘doc1’ on a notification message half way through code.
I had reused the 1st notification message code and forgot to replace all of the references to ‘doc’ with ‘doc1’
Cheers
Paul