Improve robustness as per discussion