Adding check for the directory already existing