add check for exist the pid