fixing template bug