Fix pointer drop problem