Updated code to support modern cards