Add error handling for negative values