checkDir script