use sameCardsID = []; instead of splice()