fix mem bug by changing c strings to cpp strings