proxy: implemented PID control, fixed stat update