fixing $CMD execution