using a listener to update card variable