missing .exists() method call in dir existence check added

missing .exists() method call in dir existence check added