functionality for adding a card