Make hasCard more robust