add exit statement for for-loop and sub application.