Changed logic in sync writer.