Update the Loss Function