Edit to more robust to incomplete result