Adding initial directory checking