Fix Bug with tags script.

Fixed bug with wrong variable used.