Updated to support multiple domain on the same host and unwritable pid