fix rewrite for tag