kill process use communicate instead of wait