take care of negative values
defect fix