fixing tuples for writing