avoid use of ref. to possibly deleted object

Change-Id: If5977b280fed8d8b053f59852d3984a59ce61a69