Added error handling for missing cards