better script for fixing tags