some bugs for negative values