fix realized gain