avoided double check of dir