working out bugs with template commands