Fixed using . as a second parameter, checking whether a directory already exists and aborts execution with an error message