fix the pointer issues