add database saving functionality to card