Fixed error with hash dir function