fix: fix buffer not cleaned when compiled template rendered multiple times