added templated PID