finish sync file functionality