fix defer