update code to collapse tag by id