added null terminate to string