improve tagging functionality