fixing the last timestep gfi problem