fix error for exited processes
added EnableRaisingEvents