Fix multiple pids issues. Add script to fix issue in setup. Add triggers and functions for a better pids support