Updated to exit on error