adjust the API for robustness