added terminal tag functionality