fix error handling when adding card