added exit feature