Fixed the pid bug