Modify merge logic for local and server data