logic for cards to flip back after clicking on two cards