Fix dangling reference