Changed search function to return the card object