more code for dynamic smsg in Gemini