added method to toggle favorite icon