added exit controls;