Stale pointer bug