rewrite tag generate method