error handler for cards