fixed some bugs and added card ids