fixed error that was caused on restoring of a template