Add tag script
Improved cleanup and checking on tag script