stop running if an error occurs