fix Isidentity function