Added error handling to createTopFiveCards()