debugging template problem