fix const pointer issues