fix problems in template