wait process end before read inputstream