Added correct csv write method