added NaN test for determinant