Move defer outside the closure