Made app close upon sample complete