fix logic for isNegative