Added the option to switch between single/nested PID