Added checking directory.