Fixing the massive error with failure logic and emails