more robust error stuff