fix gainloss