fixed a bug where %TAG isn't expanded