Fixed string mem allocation issue