Changed error handling for non-production again