fix bug when passing embed object to constructor