merge fix for bs mean for loss functions