some changes for robustness