template next bug