update cards code