fix some strange exit statement