fixed bug : when PID is passed,attach failed

fixed bug : when PID is passed,attach failed