Fixed write.table issue