some changes to embed.js