Updated js for embedding