minor changes. still can't get terminate to work