Changes  for writing tmx only once