fixed a bug when determining the determinant