more robust error handling around model dispatch