templates creation bugfix