Different tabs showing same content in the shiny server but they are showing different content when run from Rstudio Server

I am making a shiny app which creates dynamic tabs in the body of the shiny dashboard. It uses appendTab function to add new tabs. Although the tabs are created correctly and display relevant content in the Rstudio Server, the shiny app is making new tabs but with the same content on the shiny-server. After inspecting the html source, I was able to find that the new tabs although have different names, the relevant page's div id is same and it's always "tabs-xxxx-NaN" where xxxx is some 4 digit number. Kindly help me.