fixing ctlr+c for engines started in foreground