fixed small bug in loss computation"