Fix missing update of parent in loop when resource already exists