fixed some bugs in buydevcard