support multiple pids and other minor things