Fixed error when directory wasnt found.