fix wrong condition for cardDim