fix bugs for tag saving