update logic for ejs templating