Fixed writeOut funcion missing last character