Write the mesage into the file