Adding some logic to the synchronize action.