query on tags and edit function