small change to write.table