add exit to terminating