The correction in flow appending and updating worked, now it should be fixed the flowStopped function. Also, try to correct the measurements of flow length