added exit handlers