fixes bug in template