converting array to json for sync