added timeout feature for PHI