fix gfi calculation