Added the exit statement after for the second MATLAB run