added feature to restart agent process on uncaughtException and fixed SIGINT event listeners