added a time delay before calling addprimserviceattributes function.
This seems to be a timing issue.  When a breakpoint is added here, everything inits ok.  if no breakpoint, some error occurs.