Add error check for negative input values.