minor fix for dir function