Updated sync to handle deletes