Added sum error handling