fixed save TAM bug with id instead of mi_id in template