fixing pid bug