Isolating variable from defer when calling its stack