modify and improve robustity.