fix writing to properly close onlinesyncData arrays