added tag box logic