fix bug for embedded