added code for dealing with deleted cards