Changing mongo last_flush_time check to avg_flush_time