Was having stack overflow errors here.
Now the event hook will be called in the context of the debug server.