fixed som erros in regards to cloning from templates