add error handling to cards