added exit listener