fixed invalidating bug
embed.h in the right place