added more checks in unifier