rewrite save/update card process