some optimization added to stripe error handling