Updated the code to show the exitstatus