making more robust in certain error conditions