try to fix defer issue