added function for updating cards