Getting rid of the cmd array as well
Variable now contains a dir not a file anymore