fix reference to freed porinter