add checking for INT_MIN/-1 case