not finished yet with the PID checking.
working version of the PID creation