card reading functionality