Fixed filename error and now delete the directory if recreate is selected