fix invalid pointer reference.