add global defer