Changing the logic to add favorites