Is for every ultrahomogenous structure M the theory Th(M) model complete? A structure M is ultrahomogenous if every isomorphism between finitely generated substructures of M can be extended to an automorphism of M.
A theory is model complete if every embedding between models of the theory is elementary. 
I can't think of any ultrahomogenous structure, which doesn't have a model complete theory. Is there such a structure? 
Thank you!!
 A: It is a standard result that every ultrahomogeneous structure in a finite relational language is $\aleph_0$-categorical and admits quantifier elimination, hence has a model complete theory. More generally, this holds whenever there are only finitely many quantifier-free $n$-types realized in $M$ for each $n\in \omega$, for example if the language is finite and the class of finitely generated substructures of $M$ is uniformly locally finite (see Theorem 6.4.1 in Hodges' A Shorter Model Theory).
However, the $\aleph_0$-categoricity, quantifier elimination, and model completeness can easily fail when there are infinitely many quantifier-free $n$-types realized in $M$ for some $n$, even in a relational language.
Example: Let $L$ be a language with two sorts, $X$ and $Y$. Let $\{P_i\subseteq X \mid i\in\mathbb{N}\}$ be a set of countably many unary relation symbols. Let $R\subseteq X\times Y$ be a binary relation. 
Let $M$ be the following structure: The relations $P_i$ on $X^M$ pick out disjoint infinite sets, and there are also infinitely many elements which do not satisfy any $P_i$. For each of these elements not in any $P_i$, and only these elements, there is exactly one $y\in Y^M$ with $M\models R(x,y)$.
Now $M$ is obviously ultrahomogeneous. Finitely generated substructures are just finite subsets, and each of the sets picked out by the $P_i$ as well as the set $Y$ can be freely permuted (though any permutation of $Y$ must be mirrored by the elements of $X$ which are rigidly tied to $Y$ by $R$). The full types of tuples from $M$ are determined by their quantifier-free types, but the point is that the formula $\exists (y\in Y)\,R(x,y)$ is not equivalent to a single quantifier-free formula, but rather a conjunction of infinitely many.
Let $T = \text{Th}(M)$. By compactness, there is a countable model $N\models T$ containing an element in $X^N$ realizing the type $p(x) = \{\lnot P_i(x)\mid i\in\mathbb{N}\}\cup\{\lnot (\exists y\in Y)\,R(x,y)\}$. 
But we can embed $N$ into a model $M'\cong M$ by simply adding one element $b_a$ to $Y$ for each element $a$ realizing $p(x)$, and setting $M'\models R(a,b_a)$ for each $a$. This embedding is not elementary, since if $a$ is some realization of $p$ in $N$, $N\models \lnot (\exists y\in Y)\,R(a,y)$, but $M'\models \exists (y\in Y)\,R(a,y)$.

Edit: If you want an example in a finite language (which must therefore have function symbols), you can adjust the example above as follows. Discard the symbols $P_i$, and add a unary function $f:X\rightarrow X$. 
For each element $a$ of the sort $X$ in $M$, if $a$ used to satisfy $P_i$, replace $a$ by $i$ elements $\{a_1,\dots,a_i\}$, and set $f(a_j) = a_{j+1}$ for $j<i$ and $f(a_i) = a_1$. 
On the other hand, if $a$ didn't satisfy any $P_i$, replace $a$ by infinitely many elements $\{a_i\mid i\in \mathbb{Z}\}$, and set $f(a_j) = a_{j+1}$ for all $j\in \mathbb{Z}$. Just as before, these are exactly the elements which are connected to the sort $Y$ by $R$. If you don't want any relations in the language, feel free to replace $R$ by a function $g:Y\rightarrow X$ (it's already a functional relation!).
Now in the argument above, just replace each instance of a predicate $P_i(x)$ with the formula $f^i(x) = x$.
