few modifications concerning tag func.