fixed bug in pid.c where previous value was not stored