update_flowrate() fix divided by zero