Added check for negative values