improve tag functionality